package net.sareweb.acab.session;

import net.sareweb.acab.entity.*;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.framework.EntityQuery;
import java.util.Arrays;

@Name("travelList")
public class TravelList extends EntityQuery<Travel> {

	private static final String EJBQL = "select travel from Travel travel";

	private static final String[] RESTRICTIONS = {
			"lower(travel.name) like lower(concat(#{travelList.travel.name},'%'))",
			"lower(travel.travelState) like lower(concat(#{travelList.travel.travelState},'%'))",
			"lower(travel.cronExpression) like lower(concat(#{travelList.travel.cronExpression},'%'))", };

	private Travel travel = new Travel();

	public TravelList() {
		setEjbql(EJBQL);
		setRestrictionExpressionStrings(Arrays.asList(RESTRICTIONS));
		setMaxResults(25);
	}

	public Travel getTravel() {
		return travel;
	}
}
